﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KBManagement.DAL;
namespace KBManagement.BIZ
{
    class FoodCategoryFacade :FacadeBase<FoodCaterory>
    {
        public FoodCategoryFacade()
        {
           
        }
        public override IQueryable Select()
        {
            var foodCategorys = from fc in Library.Utils.CreateInstance().GetDBContext().FoodCaterories select fc;
            return foodCategorys;
        }


        public override FoodCaterory Find(object id)
        {
            return Library.Utils.CreateInstance().GetDBContext().FoodCaterories.Single(x => x.ID.Equals(id));
        }

        public override FoodCaterory[] FindMany(object id)
        {
            throw new NotImplementedException();
        }

        public override FoodCaterory[] SelectEntities()
        {
            var foodCategorys = from fc in Library.Utils.CreateInstance().GetDBContext().FoodCaterories select fc;
            return foodCategorys.ToArray();
        }
    }
}
